mysql -uroot -proot -hhadoop2<<EOF
use sqlserver;
UPDATE transaction_items_cashbox set transaction_date=
(SELECT b.transaction_date from transactions as b where transaction_items_cashbox.transaction_id=b.transaction_id
and transaction_items_cashbox.station_id=b.station_id
);

UPDATE transaction_items_mop set transaction_date=
(SELECT b.transaction_date from transactions as b where transaction_items_mop.transaction_id=b.transaction_id
and transaction_items_mop.station_id=b.station_id
);

UPDATE transaction_items_notoil set transaction_date=
(SELECT b.transaction_date from transactions as b where transaction_items_notoil.transaction_id=b.transaction_id
and transaction_items_notoil.station_id=b.station_id
);

-- UPDATE transaction_items_oil,transactions set transaction_items_oil.transaction_date=
-- transactions.transaction_date where transaction_items_oil.transaction_id=transactions.transaction_id
-- and transaction_items_oil.station_id=transactions.station_id;

UPDATE transaction_period set transaction_date=
(SELECT b.transaction_date from transactions as b where transaction_period.transaction_id=b.transaction_id
and transaction_period.station_id=b.station_id
);

EOF